import request from '@/utils/request';
import Constants from '@/utils/constants';

const serviceName = 'micro';

export async function microList(params) {
  return request(`${Constants.SERVICE_ROOT}/${serviceName}/list`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function addMicro(params) {
  return request(`${Constants.SERVICE_ROOT}/${serviceName}/add`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function updateMicro(params) {
  return request(`${Constants.SERVICE_ROOT}/${serviceName}/update`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function deleteMicro(params) {
  return request(`${Constants.SERVICE_ROOT}/${serviceName}/delete`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function microDetail(params) {
  return request(`${Constants.SERVICE_ROOT}/${serviceName}/detail`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
